<?php
require_once $_SERVER["DOCUMENT_ROOT"]."/inc/core/env.inc.php";

$return["success"] = false;
$return["html"] = null;
$return["error"] = null;

if (!isset($_PAGE)) {
	$_PAGE = new Page ($_POST["labelPage"]);
}

//if ($_USER->login && $_USER->asPermission('set_permissions')) {
if ($_USER->login) {
	$return['success'] = true;
	
	$menuPages = new Menu($_POST["parent"], 'admin-menu-r', true, true);
	//$return["html"] = $translate->traslate($menuPages->html(), $_SESSION["LANGUAGE"]);
	$return["html"] = $menuPages->html();
	
}  else {
	$return["error"] = $_TRANSLATE->traslate('{VOCABULARY|permission_disactive}', $_SESSION['LANGUAGE']);
}

echo '('.json_encode($return).')';
?>